package org.csmzxy.class2333;

public class 第二题 {
        public static int sumOfPrimes() {
            int sum = 0;
            for (int num = 2; num < 100; num++) {
                boolean isPrime = true;
                for (int i = 2; i * i <= num; i++) {
                    if (num % i == 0) {
                        isPrime = false;
                        break;
                    }
                }
                if (isPrime) {
                    sum += num;
                }
            }
            return sum;
        }

        public static void main(String[] args) {
            int result = sumOfPrimes();
            System.out.println("100以内的素数之和为: " + result);
        }
    }

